package com.heima.user.contrller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.UserRelationDto;
import com.heima.user.service.ApUserFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/api/v1/user")
@RefreshScope
public class ApUserFollowController {
    @Autowired
    private ApUserFollowService apUserFollowService;
    @PostMapping("/user_follow")
    public ResponseResult userFollow(@RequestBody UserRelationDto dto, HttpServletRequest request){

        return   apUserFollowService.save(dto, request);

    }
}
